import { createApp } from 'vue'
import './style.css'
import './assets/fonts/iconfont.css'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import 'nprogress/nprogress.css'

import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { useAuthStore } from './store/authStore'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)


const app=createApp(App);

//全局的自定义指令
app.directive('color', {
  mounted(el,binding) {
    console.log(el,binding);
    el.style.color=binding.value
  }
})

app.directive('button', {
  mounted(el,binding) {


    const store= useAuthStore();

      const ids=store.permissionButtonId;

      if(!ids.includes(binding.value)){
        //el.style.display='none'

        el.parentNode.removeChild(el);
      } 



  }
})




app.use(pinia).use(router).mount('#app')
